﻿#pragma once

#include "Transform.h"

namespace Base {

	class Camera
	{
	public:

		Camera() {}
		virtual ~Camera() {}

		void SetPerspective(float fovy, float aspect, float pNear, float pFar);
		void UpdateAspect(float aspect);
		void SetLookAt(const Vec3& pos, const Vec3& target, const Vec3& up);

		Matrix4x4& GetViewMatrix() {
			return mViewMatrix;
		}
		Matrix4x4& GetProjMatrix() {
			return mProjMatrix;
		}

	protected:
		std::shared_ptr<Transform> m_transform;

		Matrix4x4 mViewMatrix;
		Matrix4x4 mProjMatrix;

		// fovy 是弧度
		float mFovy, mAspect, mNear, mFar;

		// viewPort???
	};


	//------------------------------------------
	class FirstPersonCamera :public Camera {

	public:

	};


	//------------------------------------------
	class ThirdPersonCamera :public Camera {

	public:
		float m_distance, m_minDistanc, m_maxDistance;
	};
}

